import React, { Component } from 'react';
import EditableTable from './components/EditableTable';
import { Tab } from '@icedesign/base';
import cookie from 'react-cookies'
const TabPane = Tab.TabPane;
const tabs = [
  { tab: "高校", key: 0, content: <EditableTable value="高校单位指标" /> },
  { tab: "企业", key: 1, content: <EditableTable value="企业单位指标" /> },
];
function onChange(key) {
  console.log("change", key);
}

function handleClick(key) {
  console.log("click", key);
}

function onMouseEnter(key, e) {
  console.log("enter", e.target, key);
}

function onMouseLeave(key, e) {
  console.log("leave", e.target, key);
}
const auth = cookie.load('user')
export default class Pagexinzeng extends Component {

  static displayName = 'Pagexinzeng';

  constructor(props) {
    super(props);
    this.state = {};

  }


  render() {
    console.log('role',auth)
    return (
      auth === '超级管理员' ?
        <div className="pagexinzeng-page">
          <Tab triggerType="click" onChange={onChange}>
            {tabs.map(item => (
              <TabPane key={item.key} tab={item.tab} onClick={handleClick}>
                {item.content}
              </TabPane>
            ))}
          </Tab>
        </div> :
        <EditableTable value={`${auth}`} />
    );
  }
}
